package entity

import (
	"comm/selfreg"
	"core/class"
	"core/datetime"
	"reflect"
)

type CommProxy struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;autoIncrement:false;comment:主键;"`

	Name string `json:"name"      validate:"required,max=50"   gorm:"column:name;size:50;DEFAULT:'';not null;comment:名称;"`

	Special bool `json:"special"      validate:""   gorm:"column:special;DEFAULT:false;type:tinyint(1);not null;comment:是否通用;"`

	EndPoint string `json:"endPoint"      validate:"required,max=50"   gorm:"column:end_point;size:50;DEFAULT:'';not null;comment:通讯地址;"`

	Memo string `json:"memo"                             gorm:"column:memo;size:2000;DEFAULT:'';not null;comment:备注;"`

	CrtDt   datetime.MyTime    `json:"crtDt"                            gorm:"column:crt_dt;not null;comment:创建日期;"`
	CrtUid  int64              `json:"crtUid,string"                    gorm:"column:crt_uid;DEFAULT:0;not null;comment:创建人编号;"`
	CrtDid  int64              `json:"crtDid,string"                    gorm:"column:crt_did;DEFAULT:0;not null;comment:机构编号;"`
	EdtDt   datetime.MyTime    `json:"edtDt"                            gorm:"column:edt_dt;not null;comment:修改日期;"`
	EdtUid  int64              `json:"edtUid,string"                    gorm:"column:edt_uid;DEFAULT:0;not null;comment:修改人编号;"`
	Gid     string             `json:"gid"                              gorm:"column:gid;DEFAULT:'';type:char(36);not null;comment:Gid;"`
	Deleted datetime.DeletedAt `json:"deleted"                          gorm:"column:deleted;DEFAULT:0;type:tinyint(1);not null;comment:删除标志;"`
}

func (p *CommProxy) TableName() string {
	return "CommProxy"
}

func init() {

	var mcls = &CommProxy{}
	var m = &class.MyClass{
		Name:     "采集器",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddEntity(m)
}
